import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author yzh
 * @version 1.0
 * @date 2021/12/22 20:04
 * 素数对猜想
 * 算法：数学
 */
public class _1007 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), ans = 0;
        List<Integer> list = new ArrayList<>(n);
        for (int i = 1; i <= n; i++) if (judgeSushu(i)) list.add(i);
        for (int i = 1; i < list.size(); i++) if (list.get(i) - list.get(i - 1) == 2) ++ans;
        System.out.println(ans);
    }

    static boolean judgeSushu(int n) {
        if (n == 1 || n == 2 || n == 3) return true;
        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) return false;
        }
        return true;
    }

}
